From 2777bbcde17adfd7f828f97b52bdae1dc70b5c1c Mon Sep 17 00:00:00 2001 From: robertl Date: Sat, 2 Sep 2006 23:18:28 +0000 Subject: [PATCH] Main: issue error when format doesn't support realtime tracking. Msroute: ole header has unsigned char constants, so make it match. --- gpsbabel/main.c | 8 ++++++++ gpsbabel/msroute.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gpsbabel/main.c b/gpsbabel/main.c index 6acee034e..59ff76ff9 100644 --- a/gpsbabel/main.c +++ b/gpsbabel/main.c @@ -446,6 +446,14 @@ main(int argc, char *argv[]) fatal("Realtime tracking (-T) is exclusive of other modes.\n"); } + if (ovecs) { + if (!ovecs->position_ops.wr_init || + !ovecs->position_ops.wr_position || + !ovecs->position_ops.wr_deinit) { + fatal ("This output format does not support realtime positioning.\n"); + } + } + while (1) { wpt = ivecs->position_ops.rd_position(); if (wpt) { diff --git a/gpsbabel/msroute.c b/gpsbabel/msroute.c index eadc4a8c8..a616b5852 100644 --- a/gpsbabel/msroute.c +++ b/gpsbabel/msroute.c @@ -70,7 +70,7 @@ typedef struct msroute_head_s #define BLOCKS(a, b) (((a) + (b) - 1) / (b)) -static const char ole_magic[8] = +static const unsigned char ole_magic[8] = { 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 }; @@ -375,7 +375,7 @@ ole_init(void) memset(&head, 0, sizeof(head)); fread(&head, sizeof(head), 1, fin); - is_fatal((strncmp(head.magic, ole_magic, sizeof(ole_magic)) != 0), MYNAME ": No MS document."); + is_fatal((strncmp(head.magic, (char *) ole_magic, sizeof(ole_magic)) != 0), MYNAME ": No MS document."); head.rev = le_read16(&head.rev); head.ver = le_read16(&head.ver); -- 2.30.2